package com.start;



import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

/**
 * Created by wtang on 14-11-24.
 */
public class Start {

    public static void main(String[] args) throws Exception {
        final int port = Integer.getInteger("port", 8000);
        //final String contextPath = System.getProperty("context", "" + "/dd_pos_sync");
        final String contextPath = System.getProperty("context", "");

        Server server = new Server(port);
        WebAppContext context = new WebAppContext("src/main/webapp/", contextPath);
        context.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
        context.setInitParameter("org.apache.el.parser.COERCE_TO_ZERO", "true");
        System.setProperty("org.apache.el.parser.COERCE_TO_ZERO", "true");
        context.setDescriptor("src/test/resources/web.xml");
        server.setHandler(context);
        server.setStopAtShutdown(true);

        server.start();
    }
}
